package com.lfp.consumer;

import com.lfp.config.rabbitmq.DelayedQueueConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Description 基于插件的延时队列消息
 * @Author lfp
 * @Date 2022/7/19
 * @Version 1.0
 */
@Slf4j
@Component
public class DelayedQueuePluginConsumer {

    @RabbitListener(queues = DelayedQueueConfig.DELAYED_QUEUE_NAME)
    public void receivedDelayQueue(Message message){
        String msg = new String(message.getBody());
        log.info("接收到基于插件的延时队列消息：{}",msg);
    }
}
